package com.etoak.api;

import com.etoak.common.core.vo.ResultVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;

@FeignClient(name = "upload-service")
@Service
public interface UploadService {
    /**
     * 调用图片上传接口
     * 1、PostMapping 需要配置 consumes 属性, consumes="multipart/form-data"
     * 2、参数 MultipartFile 前增加 @RequestPart
     */
    @PostMapping(value = "/upload/image",consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    ResultVO<String> upload(@RequestPart MultipartFile pic) throws IOException;
}
